<template>
  <view class=""><u-parse :html="agreementContent"></u-parse></view>
</template>
<script>
export default {
  data() {
    return {
      agreementType: '', // 协议类型
      agreementContent: '' // 协议内容
    };
  },
  onLoad(options) {
    if (options.type) {
      this.agreementType = options.type;
      this.getData(this.agreementType);
    }
  },
  methods: {
    async getData(type) {
      const res = await uni.$u.api.getPolicy({ type });
      agreementContent = res.content;
      uni.setNavigationBarTitle({
        title: String(res.title)
      });
    }
  }
};
</script>

<style lang="scss" scoped></style>
